package so.sao.code.service.infrastructure.enums;

import so.sao.top.core.util.enums.NamedEnumEntity;

public enum TAG_SCRAP_STATUS implements NamedEnumEntity<Integer> {
	SCRAPSUCCESS(1, "报废成功"),

	SCRAPFAILD(2, "报废失败");

	private Integer value;

	private String name;

	TAG_SCRAP_STATUS(Integer value, String name) {
		this.name = name;
		this.value = value;
	}

	@Override
	public Integer getValue() {
		return value;
	}

	@Override
	public String getName() {
		return name;
	}

	public static TAG_SCRAP_STATUS fromValue(Integer id) {
		switch (id) {
		case 1:
			return SCRAPSUCCESS;
		case 2:
			return SCRAPFAILD;
		default:
			throw new IllegalArgumentException("Value [" + id + "] not support!");
		}
	}
}
